﻿using System.Collections.Generic;
using System.Windows.Forms;

// Program to view simple DICOM images.
// Written by Amarnath S, Mahesh Reddy S, Bangalore, India, April 2009.

namespace SARD.Aux_Forms
{
    public partial class DicomTagsForm : Form
    {
        List<string> str;


        /// <summary>
        /// Shows the dicom tags of the image.
        /// </summary>
        public DicomTagsForm()
        {
            InitializeComponent();
        }

        public void SetString(ref List<string> strg)
        {
            str = strg;
            string s1, s2, s3, s4, s5, s11, s12;
            int ind;

            // Add items to the List View Control
            for (int i = 0; i < str.Count; ++i)
            {
                s1 = str[i];
                ind = s1.IndexOf("//");
                s2 = s1.Substring(0, ind);

                s11 = s1.Substring(0, 4);
                s12 = s1.Substring(4, 4);

                s3 = s1.Substring(ind + 2);
                ind = s3.IndexOf(":");
                s4 = s3.Substring(0, ind);
                s5 = s3.Substring(ind + 1);

                ListViewItem lvi = new ListViewItem(s11);
                lvi.SubItems.Add(s12);
                lvi.SubItems.Add(s4);
                lvi.SubItems.Add(s5);
                listView1.Items.Add(lvi);
            }
        }

        private void bnClose_Click(object sender, System.EventArgs e)
        {
            this.Close();
        }
    }
}
